import request from '@/utils/request2'
import request1 from '@/utils/request'
import { producerApisUrl, projectApiUrl } from '@/api/config'
const schedulePlanMonth = producerApisUrl + '/schedulePlanMonth' // 施工总计划-月计划
const scheduleNodeMonth = producerApisUrl + '/scheduleNodeMonth' // 月计划节点表
const scheduleMonthWorkResult = producerApisUrl + '/scheduleMonthWorkResult' // 月计划节点维护表
const scheduleBulletinBoardGet = producerApisUrl + '/schedule/bulletin/board/get' // 月计划-看板
const scheduleNodeMonthWeekReview = producerApisUrl + '/scheduleNodeMonthWeekReview' // 月/周计划节点维护复核情况表
export default {
  /**
   * @description: 月计划-看板 获取看板信息
   */
  boardGet: (data) => {
    return request({
      url: scheduleBulletinBoardGet,
      method: 'get',
      params: data
    })
  },
  /**
   * @description: 月计划-看板 获取日历
   */
  boardCalendar: (data) => {
    return request({
      url: scheduleBulletinBoardGet + `/calendar`,
      method: 'post',
      data
    })
  },
  /**
   * @description: 月计划-看板 获取完成详情
   */
  boardCompleteDetail: (data) => {
    return request({
      url: scheduleBulletinBoardGet + `/complete/detail`,
      method: 'get',
      params: data
    })
  },
  /**
   * @description: 月计划-看板 获取按时完成详情
   */
  boardOnTimeCompleteDetail: (data) => {
    return request({
      url: scheduleBulletinBoardGet + `/on/time/complete/detail`,
      method: 'get',
      params: data
    })
  },
  /**
   * @description: 月计划导出Excl
   */
  monthExcl: (id) => {
    return request1({
      url: schedulePlanMonth + `/excl/${id}`,
      method: 'get',
      responseType: 'blob',
    })
  },
  /**
   * @description: 月计划导出Excl
   */
  monthExclAll: (data) => {
    return request1({
      url: schedulePlanMonth + `/excl/month`,
      method: 'post',
      responseType: 'blob',
      data
    })
  },
  /**
   * @description: 施工总计划-月计划 获取月计划树
   */
  getMonthTree: (data) => {
    return request({
      url: schedulePlanMonth + `/get/month/tree`,
      method: 'post',
      data
    })
  },
  /**
   * @description: 施工总计划-月计划 提交
   */
  submitAuditStatus: (id, auditStatus) => {
    return request({
      url: schedulePlanMonth + `/submit/${id}/${auditStatus}`,
      method: 'get',
    })
  },
  /**
   * @description: 月计划节点表 获取月计划树
   */
  getNodeTree: (data) => {
    return request({
      url: scheduleNodeMonth + `/get/node/tree`,
      method: 'post',
      data
    })
  },
  /**
   * @description: 月计划节点表 添加节点信息
   */
  addnode: (data) => {
    return request({
      url: scheduleNodeMonth + `/add/node`,
      method: 'post',
      data
    })
  },
  /**
   * @description: 月计划节点表 修改节点信息
   */
  updateNode: (data) => {
    return request({
      url: scheduleNodeMonth + `/update/node`,
      method: 'post',
      data
    })
  },
  /**
   * @description: 月计划节点表 删除节点信息
   */
  deleteNode: (data) => {
    return request({
      url: scheduleNodeMonth + `/delete/node`,
      method: 'get',
      params: data
    })
  },
  /**
   * @description: 月计划节点表 上移
   */
  moveUp: (data) => {
    return request({
      url: scheduleNodeMonth + `/move/up`,
      method: 'post',
      data
    })
  },
  /**
   * @description: 月计划节点表 下移
   */
  moveDown: (data) => {
    return request({
      url: scheduleNodeMonth + `/move/down`,
      method: 'post',
      data
    })
  },
  /**
   * @description: 月计划节点表 查询节点信息
   */
  nodeList: (data) => {
    return request({
      url: scheduleNodeMonth + `/node/list`,
      method: 'post',
      data
    })
  },
  /**
   * @description: 月计划节点维护表 节点完成
   */
  addResult: (data) => {
    return request({
      url: scheduleMonthWorkResult + `/add/result`,
      method: 'post',
      data
    })
  },
  /**
   * @description: 月计划节点表 获取最新的维护结果
   */
  getFinalResult: (data) => {
    return request({
      url: scheduleMonthWorkResult + `/get/final/result`,
      method: 'get',
      params: data
    })
  },
  /**
   * @description: 月计划节点表 设置完成
   */
  setComplete: (data) => {
    return request({
      url: scheduleMonthWorkResult + `/set/complete`,
      method: 'get',
      params: data
    })
  },
   /**
   * @description: 月/周计划节点维护复核情况表 添加复核
   */
   createReview: (data) => {
    return request({
      url: scheduleNodeMonthWeekReview + `/create/review`,
      method: 'post',
      data
    })
  },
  /**
   * @description: 月/周计划节点维护复核情况表 查询复核数据
   */
  queryReviews: (data) => {
    return request({
      url: scheduleNodeMonthWeekReview + `/query/reviews`,
      method: 'post',
      data
    })
  },
}
